#include "shm.hpp"
#include "fifo.hpp"
int main()
{
    shm shm(default_path, default_proj_id, "creater");
    NamedFifo readFifo(PATH, FILENAME);
    FileOpt readOpt(PATH, FILENAME);
    readOpt.OpenForRead();

    sleep(5);
    char *mem = (char *)shm.VisualAddr();
    while (true)
    {
        // 需要阻塞等待
        if (readOpt.Wait())
        {
            printf("%s\n", mem);
        }
        else
        {
            break;
        }
    }
    readOpt.Close();
    return 0;
}
